package com.crealth.mapper;


import java.util.List;
import java.sql.Timestamp;

import org.apache.ibatis.annotations.Param;

import com.crealth.Result.FollowupConsumerResult;
import com.crealth.model.ConsumerCarModel;
import com.crealth.model.ConsumerCreditCardModel;
import com.crealth.model.ConsumerFollowupModel;
import com.crealth.model.ConsumerHouseModel;
import com.crealth.model.ConsumerInfoModel;
import com.crealth.model.ConsumerLoanModel;
import com.crealth.model.ConsumerNextFollowupModel;
import com.crealth.model.ConsumerPolicyModel;
import com.crealth.model.ConsumerSelfModel;
import com.crealth.model.ConsumerWorkModel;


public abstract interface ConsumerInfoMapper {
	
	public abstract List<ConsumerInfoModel> selectConsumerInfoByUserID(
			@Param("userID")int userID,
			@Param("downMinid")int downMinid);
	public abstract List<ConsumerInfoModel> selectConsumerInfoByUserIDs(
			@Param("userIDs")String userIDs,
			@Param("downMinid")int downMinid);
	public abstract List<ConsumerInfoModel> selectAllConsumerInfo(
			@Param("downMinid")int downMinid);
	public abstract List<ConsumerInfoModel> selectConsumerInfoByUserIDTm(
			@Param("userID")int userID,
			@Param("localTm")Timestamp localTm);
	public abstract List<ConsumerInfoModel> selectConsumerInfoByUserIDsTm(
			@Param("userIDs")String userIDs,
			@Param("localTm")Timestamp localTm);
	public abstract List<ConsumerInfoModel> selectAllConsumerInfoTm(
			@Param("localTm")Timestamp localTm);
	
	public abstract List<ConsumerInfoModel> selectTodaySubmitConsumer(String strToday);
	public abstract Integer updateSendBackConsumer(@Param("id")int id);
	
	public abstract List<ConsumerInfoModel> selectConsumerByIDs(
			@Param("ids")String ids);
	
	public abstract List<Integer> selectConsumerIDByUserID(
			@Param("userID")int userID);
	public abstract List<Integer> selectConsumerIDByIDs(
			@Param("userIDs")String userIDs);
	public abstract List<Integer> selectAllConsumerID();
	public abstract List<Integer> selectConsumerIDByUserIDLimit(
			@Param("userID")int userID, 
			@Param("downMinid")int downMinid);
	public abstract List<Integer> selectConsumerIDByUserIDsLimit(
			@Param("userIDs")String userIDs,
			@Param("downMinid")int downMinid);
	public abstract List<Integer> selectAllConsumerIDLimit(
			@Param("downMinid")int downMinid);
	public abstract List<ConsumerInfoModel> selectAllConsumer();
	public abstract List<Integer> selectUserConsumerIDs(
			@Param("userID")int userID);
	
	public abstract List<ConsumerInfoModel> selectConsumerByPhoneNum(
			@Param("phoneNum")String phoneNum);
	
	public abstract List<ConsumerInfoModel> selectUserConsumerByPhoneNum(
			@Param("userID")int userID,
			@Param("phoneNum")String phoneNum);
	
    public abstract void insertConsumerInfoObj(ConsumerInfoModel consumerInfoModel);
    public abstract void insertImportPurposeExcel(ConsumerInfoModel consumerInfoModel);
    public abstract Integer selectConsumerInfoByNameAndPhone(
    		@Param("userID")int userID,
    		@Param("cliName")String cliName,
    		@Param("phoneNum1")String phoneNum1);
    public abstract Integer selectConsumerInfoByPhone(
    		@Param("userID")int userID,
    		@Param("phoneNum1")String phoneNum1);
    public abstract ConsumerInfoModel selectConsumerInfoByID(
    		@Param("consumerID")int consumerID);
    public abstract void updateConsumerInfoByID(ConsumerInfoModel consumerInfoModel);
    public abstract void updateConsumerInfoByMortgage(ConsumerInfoModel consumerInfoModel);
    public abstract Integer updateConsumerLeaderGuideByID(ConsumerInfoModel consumerInfoModel);
    public abstract void updateConsumerNameAndPhone(
    		@Param("consumerID")int consumerID,
    		@Param("strName")String strName,
    		@Param("phoneNum1")String phoneNum1);
    public abstract void updateConsumerUserByIDs(
    		@Param("ids")String ids,
    		@Param("toUser")int toUser);
    public abstract Integer updateConsumerUserByID(
    		@Param("consumerID")int consumerID,
    		@Param("toUser")int toUser,
    		@Param("setCliType")String setCliType);
    public abstract Integer updateConsumerUserLeaveOffice(
    		@Param("userID")int userID,
    		@Param("toUser")int toUser);
    public abstract void updateConsumerStatusByID(
    		@Param("consumerID")int consumerID,
    		@Param("status")int status);
    public abstract void sendBackConsumerByID(
    		@Param("consumerID")int consumerID,
    		@Param("setLevel")int setLevel);
    public abstract Integer updateConsumerFlowFollowByID(
    		@Param("consumerID")int consumerID,
    		@Param("setFlowFollow")int setFlowFollow);
    
    public abstract Integer updateConsumerTypeByPhoneNum(
    		@Param("phoneNum")String phoneNum,
    		@Param("cliType")String cliType);
    
    public abstract Integer updateConsumerTypeByID(
    		@Param("consumerID")int consumerID,
    		@Param("cliType")String cliType);
    
    public abstract Integer updateSignContractTmByID(
    		@Param("consumerID")int consumerID,
    		@Param("signTm")Timestamp signTm);
    
    public abstract Integer updateBelongCompanyByID(
    		@Param("consumerID")int consumerID,
    		@Param("belongCompany")Integer belongCompany);
    
    public abstract Integer updateSignContractTmByPhoneNum(
    		@Param("phoneNum")String phoneNum,
    		@Param("signTm")Timestamp signTm);
    
    
    public abstract ConsumerInfoModel selectConsumerLeaderGuideByID(
    		@Param("consumerID")int consumerID);
    
    public abstract List<ConsumerCarModel> selectConsumerCar(
    		@Param("consumerID")int consumerID);
    public abstract void insertConsumerCar(ConsumerCarModel carModel);
    public abstract void updateConsumerCar(ConsumerCarModel carModel);
    public abstract void deleteConsumerCar(
    		@Param("carID")int carID,
    		@Param("consumerID")int consumerID);
    
    public abstract List<ConsumerCreditCardModel> selectConsumerCreditCard(
    		@Param("consumerID")int consumerID);
    public abstract void insertConsumerCreditCard(ConsumerCreditCardModel creditCardModel);
    public abstract void updateConsumerCreditCard(ConsumerCreditCardModel creditCardModel);
    public abstract void deleteConsumerCreditCard(
    		@Param("creditCardID")int creditCardID,
    		@Param("consumerID")int consumerID);
    
    public abstract List<ConsumerHouseModel> selectConsumerHouse(
    		@Param("consumerID")int consumerID);
    public abstract void insertConsumerHouse(ConsumerHouseModel houseModel);
    public abstract void updateConsumerHouse(ConsumerHouseModel houseModel);
    public abstract void deleteConsumerHouse(
    		@Param("houseID")int houseID,
    		@Param("consumerID")int consumerID);
    
    public abstract List<ConsumerLoanModel> selectConsumerLoan(
    		@Param("consumerID")int consumerID);
    public abstract void insertConsumerLoan(ConsumerLoanModel loanModel);
    public abstract void updateConsumerLoan(ConsumerLoanModel loanModel);
    public abstract void deleteConsumerLoan(
    		@Param("loanID")int loanID,
    		@Param("consumerID")int consumerID);
    
    public abstract List<ConsumerPolicyModel> selectConsumerPolicy(
    		@Param("consumerID")int consumerID);
    public abstract void insertConsumerPolicy(ConsumerPolicyModel policyModel);
    public abstract void updateConsumerPolicy(ConsumerPolicyModel policyModel);
    public abstract void deleteConsumerPolicy(
    		@Param("policyID")int policyID,
    		@Param("consumerID")int consumerID);
    
    public abstract ConsumerSelfModel selectConsumerSelf(
    		@Param("consumerID")int consumerID);
    public abstract void insertConsumerSelf(ConsumerSelfModel selfModel);
    public abstract void updateConsumerSelf(ConsumerSelfModel selfModel);
    public abstract void deleteConsumerSelf(
    		@Param("selfID")int selfID,
    		@Param("consumerID")int consumerID);
    
    public abstract ConsumerWorkModel selectConsumerWork(
    		@Param("consumerID")int consumerID);
    public abstract Integer insertConsumerWork(ConsumerWorkModel workModel);
    public abstract Integer updateConsumerWork(ConsumerWorkModel workModel);
    public abstract void deleteConsumerWork(
    		@Param("workID")int workID,
    		@Param("consumerID")int consumerID);
    
    public abstract List<ConsumerFollowupModel> selectConsumerFollowup(
    		@Param("consumerID")int consumerID);
    public abstract Integer insertConsumerFollowup(ConsumerFollowupModel followupModel);
    public abstract Integer insertConsumerFollowupTm(ConsumerFollowupModel followupModel);
    
    public abstract List<ConsumerNextFollowupModel> selectNextFollowup(
    		@Param("consumerID")int consumerID);
    public abstract Integer insertNextFollowup(ConsumerNextFollowupModel nextFollowup);
    public abstract Integer updateNextFollowup(ConsumerNextFollowupModel nextFollowup);
    public abstract Integer deleteNextFollowup(
    		@Param("id")int id);
    
    
    public abstract List<ConsumerInfoModel> selectMeetTalkPurpose(
    		@Param("userIDs")String userIDs,
    		@Param("searchDay")Timestamp searchDay);
    
    public abstract List<ConsumerInfoModel> selectAllMeetTalkPurpose(
    		@Param("searchDay")Timestamp searchDay);
    
    public abstract List<FollowupConsumerResult> selectStatisticsFollowup(
    		@Param("searchDay")String searchDay,
    		@Param("userIDs")String userIDs);
    
    public abstract List<ConsumerInfoModel> selectAllConsumerInfoByCliType(
    		@Param("cliType")String cliType);
    
    public abstract List<ConsumerInfoModel>selectAllConsumerInfoNotSignedTm();
    
    public abstract Integer updateConsumerDeleteByIDs(
    		@Param("strIDs")String strIDs);
    
    
    //  跟单时间    早于  ltTm 
    public abstract List<Integer> selectFollowupLTTm(
    		@Param("ltTm")Timestamp ltTm);
    
    //  跟单时间    大于  gtTm
    public abstract List<Integer> selectFollowupGTTm(
    		@Param("gtTm")Timestamp gtTm);
    
    // consumer 最大的id
    public abstract Integer selectMaximumConsumerID();
    
    
}
